package com.example.controller;

import com.example.entity.FosterOrder;
import com.example.entity.ProductOrder;
import com.example.service.FosterOrderService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Auther: Nostalgia
 * @Date: 2020/7/10 11:10
 * @Description:
 */
@Controller
@RequestMapping("/fosterOrder")
public class FosterOrderController {
    @Autowired
    private FosterOrderService fosterOrderService;

    @RequestMapping("/getAllFosterOrderORByUsername")
    @ResponseBody
    public Object getAllFosterOrderORByUsername(int pageNo,int pageSize,String username){
        PageHelper.offsetPage((pageNo-1)*pageSize,pageSize);
        List<FosterOrder> fosterOrderList =fosterOrderService.getAllFosterOrderORByUsername(username);
        PageInfo<FosterOrder> pageInfo=new PageInfo<FosterOrder>(fosterOrderList);
        return pageInfo;
    }
}
